package by.siarhei.java.tij.polymorphism.exercises.ex01;

/**
 * @author Siarhei Shchahratsou <s.siarhei@gmail.com>
 * @since 23.03.2014
 */
public class Cycle {

    private static void ride(Cycle c) {
        System.out.println("Ride on " + c.getClass().getSimpleName());
    }

    public static void main(String[] args) {
        ride(new Cycle());
        ride(new Unicycle());
        ride(new Bicycle());
        ride(new Tricycle());
    }

}

class Unicycle extends Cycle {}
class Bicycle extends Cycle {}
class Tricycle extends Cycle {}
